package com.gdut.huayan.dao;

import com.gdut.huayan.entity.po.Tablet;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface TabletMapper extends BaseMapper<Tablet> {

    @Select("SELECT * FROM t_tablet WHERE id IN (SELECT tablet_id FROM t_order_detail WHERE stock_id IN (SELECT id FROM `t_stock` WHERE `festival_id` = #{param1} AND location_id = #{param2} AND activity_id = #{param3} AND print_type = #{param4}) AND order_id IN(SELECT id FROM t_order WHERE `status` = 2)) ORDER BY print_status")
    List<Tablet> getPaidTablet(Long festivalId, Long locationId, Long activityId,Integer printType);


}
